home *** CD-ROM | disk | FTP | other *** search
- <html>
-
- <head>
-
- <title>In the Yard</title>
-
- </head>
-
- <body bgcolor="white">
-
- <script language="Javascript1.2">
-
- <!--//
-
-
-
- function walkDog(d) {
-
- var dl = document.layers['puppy'];
-
- if ((dl.left == 270) || (dl.left == 200)) {
-
- if (d == 1) {
-
- dl.moveBelow(document.layers['tree']);
-
- } else {
-
- dl.moveAbove(document.layers['tree']);
-
- }
-
- if (dl.left == 200) {
-
- slideTo(dl, 70, 270);
-
- } else if (dl.left == 270) {
-
- slideTo(dl, 70, 200);
-
- }
-
- }
-
- }
-
-
-
- function slideTo(targetLayer, targetTop, targetLeft) {
-
- if((targetLayer.top != targetTop) || (targetLayer.left != targetLeft)) {
-
- if (targetLayer.top < targetTop) targetLayer.top = targetLayer.top + 1;
-
- if (targetLayer.top > targetTop) targetLayer.top = targetLayer.top - 1;
-
- if (targetLayer.left < targetLeft) targetLayer.left = targetLayer.left + 1;
-
- if (targetLayer.left > targetLeft) targetLayer.left = targetLayer.left - 1;
-
- setTimeout('slideTo(document.layers["'+targetLayer.name+'"],'+targetTop+','+targetLeft+')',1);
-
- }
-
- }
-
- //-->
-
- </script>
-
- <body bgcolor="white">
-
-
-
- <layer z-index=2 id="grass" background="grass.gif" height=200 width=200 top=0 left=150></layer>
-
-
-
- <layer z-index=4 id="tree" background="tree.gif" height=124 width=20 top=10 left=250></layer>
-
-
-
- <layer z-index=3 id="puppy" height=50 width=50 top=70 left=200>
-
- <img src="puppy.gif" border=0 height=50 width=50>
-
- </layer>
-
-
-
- <layer name="commands" top=120 left=0>
-
- <form>
-
- <input type="button" value="Go Around" width=100 onClick="walkDog(0)"><br>
-
- <input type="button" value="Go Behind" width=100 onClick="walkDog(1)">
-
- </form>
-
- </layer>
-
-
-
- </body>
-
- </html>
-
-